1. /* sxfsccov.cpp by K.Tsuru */
  2. // function ID = 512 BRADIX
  3. // since ver 2.18
  4. /************************************
  5. Radix conversion SDecimal to SDouble
  6. using "square coupling" method
  7. *************************************/
  8. #ifndef SN_H
  9. #include "sn.h"
  10. #endif
  11. /// SLong version ///
  12. SDouble SC_SDConvToSDouble(const SDecimal& x) {
  13. const SLong R(BRADIX);
  14. const fType* pf = x.ReadFigures();
  15. long p = x.Last();
  16. SLong *w = new SLong[p]; // work area
  17. for(int i = 0; i < p; i++) w[i].SetShort(pf[i+1]);
  18. SquareCouplingInverseR<SLong> cv(w, R, p);
  19. delete[] w;
  20. return (SDouble)cv.getA()/(SDouble)cv.getR() + (SDouble)pf[0]; // add integer part
  21. }

sxfsccov.cpp : last modifiled at 2017/03/13 14:32:02(673 bytes)
created at 2015/12/22 16:09:56
The creation time of this html file is 2017/10/27 15:45:59 (Fri Oct 27 15:45:59 2017).